/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package edu.project.controller;

import java.io.IOException;
import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;

/**
 *
 * @author thetrungbk
 */
public class DatabaseController {

    Connection cn = null;
    Statement st;

    public DatabaseController() throws SQLException, IOException {
        this.cn = DatabaseConnection.getConnection();
        this.st = (Statement) cn.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,
                ResultSet.CONCUR_UPDATABLE);
    }

    public ResultSet selectCommand(String cmd) throws SQLException {
       ResultSet rs = st.executeQuery(cmd);
       return rs;
    }


}
